package com.threeti.mecool.core.domain.model.basicdata;

import java.io.Serializable;

import com.threeti.mecool.core.domain.model.project.ProjectProductCollectionType;

/** 商品 */
public class Product implements Serializable,ProjectProductData {
  private String skuCode;

  private String skuName;

  private BrandCategory brandCategory;

  private Brand brand;

  public Product(String skuCode, String skuName) {
    super();
    this.skuCode = skuCode;
    this.skuName = skuName;
  }

  public Product(String code, String sku, Brand brand) {
    this(code, sku);
    this.brand = brand;
  }

  public Product(String code, String sku, Brand brand, BrandCategory brandCategory) {
    this(code, sku, brand);
    this.brandCategory = brandCategory;
  }

  public String getSkuCode() {
    return skuCode;
  }

  public String getSkuName() {
    return skuName;
  }

  public Brand getBrand() {
    return brand;
  }

  public BrandCategory getBrandCategory() {
    return brandCategory;
  }

  public void setBrandCategory(BrandCategory brandCategory) {
    this.brandCategory = brandCategory;
  }

  @Override
  public String toString() {
    return "Product [skuCode=" + skuCode + ", skuName=" + skuName + ", brandCategory=" + brandCategory + ", brand=" + brand + "]";
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((skuCode == null) ? 0 : skuCode.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Product other = (Product) obj;
    if (skuCode == null) {
      if (other.skuCode != null)
        return false;
    } else if (!skuCode.equals(other.skuCode))
      return false;
    return true;
  }

  @Override
  public String getName() {
	return skuName;
  }

  @Override
  public String getCode() {
	return skuCode;
  }
  
}
